Use gtk_search_bar_set_child throughout
authorMatthias Clasen <mclasen@redhat.com>
Sun, 3 May 2020 13:58:27 +0000 (09:58 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 May 2020 02:53:08 +0000 (22:53 -0400)
demos/gtk-demo/search_entry2.c
examples/search-bar.c
gtk/gtkshortcutswindow.c

index de8c577b917c6a89017ec88f0314a0e0defa2ba6..5e8cb6ac8b242b05343ef7979b5e81f6bdc7c1bf 100644 (file)
@@ -87,7 +87,7 @@ do_search_entry2 (GtkWidget *do_widget)
       searchbar = gtk_search_bar_new ();
       gtk_search_bar_connect_entry (GTK_SEARCH_BAR (searchbar), GTK_EDITABLE (entry));
       gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (searchbar), FALSE);
-      gtk_container_add (GTK_CONTAINER (searchbar), container);
+      gtk_search_bar_set_child (GTK_SEARCH_BAR (searchbar), container);
       gtk_container_add (GTK_CONTAINER (vbox), searchbar);
 
       /* Hook the search bar to key presses */
index 1657b2b8743829247e432d6f037078d479221ebd..c39dc8c1402c1baa27deb07bc5108f269075b329 100644 (file)
@@ -19,7 +19,7 @@ activate_cb (GtkApplication *app,
   gtk_widget_show (search_bar);
 
   box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-  gtk_container_add (GTK_CONTAINER (search_bar), box);
+  gtk_search_bar_set_child (GTK_SEARCH_BAR (search_bar), box);
 
   entry = gtk_search_entry_new ();
   gtk_widget_set_hexpand (entry, TRUE);
index 60ed0cca536d14139454c2f461afacba434302aa..93d3b40bff2cd3f81b42d4ccb8c0f280bcbdcd2a 100644 (file)
@@ -910,7 +910,8 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
   gtk_popover_set_child (GTK_POPOVER (priv->popover), GTK_WIDGET (priv->list_box));
 
   priv->search_entry = GTK_SEARCH_ENTRY (gtk_search_entry_new ());
-  gtk_container_add (GTK_CONTAINER (priv->search_bar), GTK_WIDGET (priv->search_entry));
+  gtk_search_bar_set_child (GTK_SEARCH_BAR (priv->search_bar), GTK_WIDGET (priv->search_entry));
+
   g_object_set (priv->search_entry,
                 /* Translators: This is placeholder text for the search entry in the shortcuts window */
                 "placeholder-text", _("Search Shortcuts"),